//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "s:\packages\eic\eic.h"
/*#include "priv.hpp"                                       
#include "toto.hpp"*/

#include "CEICQuery.h"
#pragma package(smart_init)

/***************************************************************************
 ***************************************************************************
 ***                         CLASSSE CEICDataSet                         ***
 ***************************************************************************
 ***************************************************************************/
class PACKAGE CEICDataSet : public TDataSet
{
public:
  virtual void          __fastcall ActivateBuffers(void);
 	virtual void          __fastcall BlockReadNext(void);
  virtual void          __fastcall CalculateFields(char * Buffer);
	virtual void          __fastcall CheckActive(void);
	virtual void          __fastcall CheckFieldCompatibility(TField* Field, TFieldDef* FieldDef);
	virtual void          __fastcall CheckInactive(void);
	virtual void          __fastcall ClearBuffers(void);
	virtual void          __fastcall ClearCalcFields(char * Buffer);
	virtual void          __fastcall CloseBlob(TField* Field);
	virtual void          __fastcall CloseCursor(void);
	virtual void          __fastcall CreateFields(void);
	virtual TDataSet*     __fastcall CreateNestedDataSet(TDataSetField* DataSetField);
	virtual void          __fastcall DataConvert(TField* Field, void * Source, void * Dest, bool ToNative);
	virtual void          __fastcall DataEvent(TDataEvent Event, int Info);
	virtual void          __fastcall DefChanged(System::TObject* Sender);
	virtual void          __fastcall DestroyFields(void);
	virtual void          __fastcall DoAfterCancel(void);
	virtual void          __fastcall DoAfterClose(void);
	virtual void          __fastcall DoAfterDelete(void);
	virtual void          __fastcall DoAfterEdit(void);
	virtual void          __fastcall DoAfterInsert(void);
	virtual void          __fastcall DoAfterOpen(void);
	virtual void          __fastcall DoAfterPost(void);
	virtual void          __fastcall DoAfterRefresh(void);
	virtual void          __fastcall DoAfterScroll(void);
	virtual void          __fastcall DoBeforeCancel(void);
	virtual void          __fastcall DoBeforeClose(void);
	virtual void          __fastcall DoBeforeDelete(void);
	virtual void          __fastcall DoBeforeEdit(void);
	virtual void          __fastcall DoBeforeInsert(void);
	virtual void          __fastcall DoBeforeOpen(void);
	virtual void          __fastcall DoBeforePost(void);
	virtual void          __fastcall DoBeforeRefresh(void);
	virtual void          __fastcall DoBeforeScroll(void);
	virtual void          __fastcall DoOnCalcFields(void);
	virtual void          __fastcall DoOnNewRecord(void);
	virtual bool          __fastcall FindRecord(bool Restart, bool GoForward);
	virtual void          __fastcall FreeFieldBuffers(void);
	virtual Variant       __fastcall GetAggregateValue(TField* Field);
	virtual int           __fastcall GetAggRecordCount(TGroupPosInd Grp);
	virtual void          __fastcall GetCalcFields(char * Buffer);
	virtual bool          __fastcall GetCanModify(void);
	DYNAMIC void          __fastcall GetChildren(Classes::TGetChildProc Proc, Classes::TComponent* Root);
	virtual TMetaClass*   __fastcall GetFieldClass(TFieldType FieldType);
	virtual AnsiString    __fastcall GetFieldFullName(TField* Field);
	virtual Variant       __fastcall GetStateFieldValue(TDataSetState State, TField* Field);
	virtual bool          __fastcall GetIsIndexField(TField* Field);
	virtual int           __fastcall GetNextRecords(void);
	virtual bool          __fastcall GetNextRecord(void);
	virtual int           __fastcall GetPriorRecords(void);
	virtual bool          __fastcall GetPriorRecord(void);
	//virtual int           __fastcall GetRecordCount(void);
	//virtual int           __fastcall GetRecNo(void);
	virtual void          __fastcall InitFieldDefs(void);
	virtual void          __fastcall InitRecord(char * Buffer);
	virtual void          __fastcall InternalCancel(void);
	virtual void          __fastcall InternalEdit(void);
	virtual void          __fastcall InternalInsert(void);
	virtual void          __fastcall InternalRefresh(void);
	virtual void          __fastcall Loaded(void);
	virtual void          __fastcall OpenCursor(bool InfoQuery);
  virtual void          __fastcall PSEndTransaction(bool Commit);
	virtual int           __fastcall PSExecuteStatement(const AnsiString ASQL, TParams* AParams, void * ResultSet);
	virtual void          __fastcall PSGetAttributes(Classes::TList* List);
	virtual TIndexDef*    __fastcall PSGetDefaultOrder(void);
	virtual AnsiString    __fastcall PSGetKeyFields();
	virtual AnsiString    __fastcall PSGetQuoteChar();
	virtual TIndexDefs*   __fastcall PSGetIndexDefs(TIndexOptions IndexTypes);
	virtual EUpdateError* __fastcall PSGetUpdateException(Sysutils::Exception* E, EUpdateError* Prev);
	virtual bool          __fastcall PSInTransaction(void);
	virtual bool          __fastcall PSIsSQLBased(void);
	virtual bool          __fastcall PSIsSQLSupported(void);
	virtual void          __fastcall PSReset(void);
	virtual void          __fastcall PSStartTransaction(void);
	virtual bool          __fastcall PSUpdateRecord(TUpdateKind UpdateKind, TDataSet* Delta);
  virtual void          __fastcall RefreshInternalCalcFields(char * Buffer);
	virtual void          __fastcall ResetAggField(TField* Field);
	//virtual void          __fastcall SetBlockReadSize(int Value);
  DYNAMIC void          __fastcall SetChildOrder(Classes::TComponent* Component, int Order);
	virtual void          __fastcall SetCurrentRecord(int Index);
	//virtual void          __fastcall SetFiltered(bool Value);
	//virtual void          __fastcall SetFilterOptions(TFilterOptions Value);
	//virtual void          __fastcall SetFilterText(const AnsiString Value);
	//virtual void          __fastcall SetRecNo(int Value);
	virtual void          __fastcall SetStateFieldValue(TDataSetState State, TField* Field, const Variant &Value);
	DYNAMIC void          __fastcall UpdateBufferCount(void);
  virtual void          __fastcall UpdateIndexDefs(void);

  DYNAMIC void __fastcall SetState(TDataSetState Value);
  DYNAMIC void __fastcall RemoveDataSource(TDataSource* DataSource);
  DYNAMIC void __fastcall AddDataSource(TDataSource* DataSource);
};


/***************************************************************************
 ***************************************************************************
 ***                     CLASSSE CEICIBCustomDataSet                     ***
 ***************************************************************************
 ***************************************************************************/
class PACKAGE CEICIBCustomDataSet : public TIBCustomDataSet
{
public:
  bool __fastcall ConstraintsStored(void){return TIBCustomDataSet::ConstraintsStored();};
};


/***************************************************************************
 ***************************************************************************
 ***                        CLASSSE CEICDBDataSet                        ***
 ***************************************************************************
 ***************************************************************************/
class PACKAGE CEICDBDataSet : public TDBDataSet
{
public:
  bool __fastcall ConstraintsStored(void){return TDBDataSet::ConstraintsStored();};
};


/***************************************************************************
 ***************************************************************************
 ***                          CLASSSE MyIBQuery                          ***
 ***************************************************************************
 ***************************************************************************/
class PACKAGE MyIBQuery : public TIBQuery
{
public:
  virtual char *        __fastcall AllocRecordBuffer(void);
  virtual void 		      __fastcall DefineProperties(Classes::TFiler* Filer);
  virtual void 			    __fastcall Disconnect(void);
	virtual void          __fastcall FreeRecordBuffer(char * &Buffer);
	virtual void          __fastcall GetBookmarkData(char * Buffer, void * Data);
	virtual TBookmarkFlag __fastcall GetBookmarkFlag(char * Buffer);
	virtual TGetResult    __fastcall GetRecord(char * Buffer, TGetMode GetMode, bool DoCheck);
	//virtual Word          __fastcall GetRecordSize(void);
	virtual void          __fastcall InternalAddRecord(void * Buffer, bool Append);
	virtual void          __fastcall InternalClose(void);
	virtual void          __fastcall InternalDelete(void);
	virtual void          __fastcall InternalFirst(void);
	virtual void          __fastcall InternalGotoBookmark(void * Bookmark);
	virtual void          __fastcall InternalHandleException(void);
	virtual void          __fastcall InternalInitFieldDefs(void);
	virtual void          __fastcall InternalInitRecord(char * Buffer);
	virtual void          __fastcall InternalLast(void);
	virtual void          __fastcall InternalOpen(void);
	virtual void          __fastcall InternalPost(void);
	virtual void          __fastcall InternalSetToRecord(char * Buffer);
	virtual bool          __fastcall IsCursorOpen(void);
  virtual void          __fastcall PSExecute(void);
	virtual TParams*      __fastcall PSGetParams(void);
	virtual AnsiString    __fastcall PSGetTableName();
	virtual void          __fastcall PSSetParams(TParams* AParams);
	virtual void          __fastcall PSSetCommandText(const AnsiString CommandText);
	virtual void          __fastcall SetBookmarkFlag(char * Buffer, TBookmarkFlag Value);
	virtual void          __fastcall SetBookmarkData(char * Buffer, void * Data);
	virtual void          __fastcall SetFieldData(TField* Field, void * Buffer);
  virtual void          __fastcall SetFieldData(TField* Field, void * Buffer, bool NativeFormat);
};


/***************************************************************************
 ***************************************************************************
 ***                           CLASSSE MyQuery                           ***
 ***************************************************************************
 ***************************************************************************/
class PACKAGE MyQuery : public TQuery
{
public:
  virtual char *        __fastcall AllocRecordBuffer(void);
  virtual void 		      __fastcall DefineProperties(Classes::TFiler* Filer);
  virtual void 			    __fastcall Disconnect(void);
	virtual void          __fastcall FreeRecordBuffer(char * &Buffer);
	virtual void          __fastcall GetBookmarkData(char * Buffer, void * Data);
	virtual TBookmarkFlag __fastcall GetBookmarkFlag(char * Buffer);
	virtual TGetResult    __fastcall GetRecord(char * Buffer, TGetMode GetMode, bool DoCheck);
	//virtual Word          __fastcall GetRecordSize(void);
	virtual void          __fastcall InternalAddRecord(void * Buffer, bool Append);
	virtual void          __fastcall InternalClose(void);
	virtual void          __fastcall InternalDelete(void);
	virtual void          __fastcall InternalFirst(void);
	virtual void          __fastcall InternalGotoBookmark(void * Bookmark);
	virtual void          __fastcall InternalHandleException(void);
	virtual void          __fastcall InternalInitFieldDefs(void);
	virtual void          __fastcall InternalInitRecord(char * Buffer);
	virtual void          __fastcall InternalLast(void);
	virtual void          __fastcall InternalOpen(void);
	virtual void          __fastcall InternalPost(void);
	virtual void          __fastcall InternalSetToRecord(char * Buffer);
	virtual bool          __fastcall IsCursorOpen(void);
  virtual void          __fastcall PSExecute(void);
	virtual TParams*      __fastcall PSGetParams(void);
	virtual AnsiString    __fastcall PSGetTableName();
	virtual void          __fastcall PSSetParams(TParams* AParams);
	virtual void          __fastcall PSSetCommandText(const AnsiString CommandText);
	virtual void          __fastcall SetBookmarkFlag(char * Buffer, TBookmarkFlag Value);
	virtual void          __fastcall SetBookmarkData(char * Buffer, void * Data);
	virtual void          __fastcall SetFieldData(TField* Field, void * Buffer);
  virtual void          __fastcall SetFieldData(TField* Field, void * Buffer, bool NativeFormat);
};


/**************************************************************************
 **************************************************************************
 ***                            CLASSSE CEICQuery                       ***
 **************************************************************************
 **************************************************************************/
//---------------------------------------------------------------------------
// ValidCtrCheck est utilisé est utilisé pour être sûr que les composants créés n'ont
// aucune fonction virtuelle pure.
//

static inline void ValidCtrCheck(CEICQuery *)
{
  new CEICQuery(NULL);
}
//---------------------------------------------------------------------------
typedef 	void __fastcall (__closure *TYPERemoveDataSource)(TDataSource* DataSource);

__fastcall CEICQuery::CEICQuery(TComponent* Owner) : TDataSet(Owner)
{
  FConstraints  = new TCheckConstraints(Owner);
  FParams       = new TParams(Owner);
  FSQL          = new TStringList();
 //FUpdateObject = new TUpdateSQL(NULL);
}
//---------------------------------------------------------------------------
__fastcall CEICQuery::~CEICQuery()
{
  if( FIBQuery)      {delete FIBQuery;      FIBQuery      = NULL;}
  if( FQuery)        {delete FQuery;        FQuery        = NULL;}
  if( FConstraints)  {delete FConstraints;  FConstraints  = NULL;}
  if( FParams)       {delete FParams;       FParams       = NULL;}
  if( FSQL)          {delete FSQL;          FSQL          = NULL;}
  //if( FUpdateObject) {delete FUpdateObject; FUpdateObject = NULL;}
  //if( FDataSetUpdateObject) delete FDataSetUpdateObject;
}

/**************************************
 *          PROPRIETES PUBLIC         *
 **************************************/
//---------------------------------------------------------------------------
// Propriété "BlockReadSize"
//---------------------------------------------------------------------------
int __fastcall CEICQuery::GetBlockReadSize(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->BlockReadSize;
    else if( FQuery)                           return FQuery->BlockReadSize;
  }
  return 0;
}
void __fastcall CEICQuery::SetBlockReadSize(int Value)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->BlockReadSize = Value;//((CEICDataSet *)FIBQuery)->SetBlockReadSize(Value);
    else if( FQuery)                           FQuery->BlockReadSize   = Value;//((CEICDataSet *)FQuery)->SetBlockReadSize(Value);
  }
}
//---------------------------------------------------------------------------
// Propriété "RecordCount"
//---------------------------------------------------------------------------
int __fastcall CEICQuery::GetRecordCount(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->RecordCount;//((CEICDataSet *)FIBQuery)->GetRecordCount();
    else if( FQuery)                           return FQuery->RecordCount;  //((CEICDataSet *)FQuery)->GetRecordCount();
  }
  return 0;
}
//---------------------------------------------------------------------------
// Propriété "RecNo"
//---------------------------------------------------------------------------
int __fastcall CEICQuery::GetRecNo(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->RecNo;//((CEICDataSet *)FIBQuery)->GetRecNo();
    else if( FQuery)                           return FQuery->RecNo;//((CEICDataSet *)FQuery)->GetRecNo();
  }
  return 0;
}
void __fastcall CEICQuery::SetRecNo(int Value)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->RecNo = Value;//((CEICDataSet *)FIBQuery)->SetRecNo(Value);
    else if( FQuery)                           FQuery->RecNo   = Value;//((CEICDataSet *)FQuery)->SetRecNo(Value);
  }
}
//---------------------------------------------------------------------------
// Propriété "RecordSize"
//---------------------------------------------------------------------------
Word __fastcall CEICQuery::GetRecordSize(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->RecordSize;//((MyIBQuery *)FIBQuery)->GetRecordSize();
    else if( FQuery)                           return FQuery->RecordSize;//((MyQuery*)FQuery)->GetRecordSize();
  }
  return 0;
}
//---------------------------------------------------------------------------
// Propriété "Filter"
//---------------------------------------------------------------------------
AnsiString __fastcall CEICQuery::GetFilterText(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->Filter;
    else if( FQuery)                           return FQuery->Filter;
  }
  return EmptyStr;
}
void __fastcall CEICQuery::SetFilterText(const AnsiString Value)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->Filter = Value;//((CEICDataSet *)FIBQuery)->SetFilterText(Value);
    else if( FQuery)                           FQuery->Filter   = Value;//((CEICDataSet *)FQuery)->SetFilterText(Value);
  }
}
//---------------------------------------------------------------------------
// Propriété "Filtered"
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::GetFiltered(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->Filtered;
    else if( FQuery)                           return FQuery->Filtered;
  }
  return false;
}
void __fastcall CEICQuery::SetFiltered(bool Value)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->Filtered = Value;//((CEICDataSet *)FIBQuery)->SetFiltered(Value);
    else if( FQuery)                           FQuery->Filtered   = Value;//((CEICDataSet *)FQuery)->SetFiltered(Value);
  }
}
//---------------------------------------------------------------------------
// Propriété "FilterOptions"
//---------------------------------------------------------------------------
TFilterOptions __fastcall CEICQuery::GetFilterOptions(void)
{
  TFilterOptions Options;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->FilterOptions;
    else if( FQuery)                           return FQuery->FilterOptions;
  }
  return Options << foCaseInsensitive;
}
void __fastcall CEICQuery::SetFilterOptions(TFilterOptions Value)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->FilterOptions = Value;//((CEICDataSet *)FIBQuery)->SetFilterOptions(Value);
    else if( FQuery)                           FQuery->FilterOptions   = Value;//((CEICDataSet *)FQuery)->SetFilterOptions(Value);
  }
}


//---------------------------------------------------------------------------
// Propriété "AggFields"
//---------------------------------------------------------------------------
TFields* __fastcall CEICQuery::GetAggFields(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->AggFields;
    else if( FQuery)                           return FQuery->AggFields;
  }
  return NULL;
}
//---------------------------------------------------------------------------
// Propriété "Bof"
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::GetBOF(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->Bof;
    else if( FQuery)                           return FQuery->Bof;
  }
  return false;
}
//---------------------------------------------------------------------------
// Propriété "Bookmark"
//---------------------------------------------------------------------------
AnsiString __fastcall CEICQuery::GetBookmarkStr()
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->Bookmark;
    else if( FQuery)                           return FQuery->Bookmark;
  }
  return EmptyStr;
}
void __fastcall CEICQuery::SetBookmarkStr(const AnsiString Value)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->Bookmark = Value;
    else if( FQuery)                           FQuery->Bookmark   = Value;
  }
}
//---------------------------------------------------------------------------
// Propriété "CanModify"
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::GetCanModify(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((CEICDataSet *)FIBQuery)->CanModify;
    else if( FQuery)                           return ((CEICDataSet *)FQuery)->CanModify;
  }
  return false;
}
//---------------------------------------------------------------------------
// Propriété "DataSetField"
//---------------------------------------------------------------------------
TDataSetField* __fastcall CEICQuery::GetDataSetField(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->DataSetField;
    else if( FQuery)                           return FQuery->DataSetField;
  }
  return NULL;
}
void __fastcall CEICQuery::SetDataSetField(const TDataSetField* Value)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->DataSetField = (TDataSetField*)Value;
    else if( FQuery)                           FQuery->DataSetField   = (TDataSetField*)Value;
  }
}
//---------------------------------------------------------------------------
// Propriété "DefaultFields"
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::GetDefaultFields(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->DefaultFields;
    else if( FQuery)                           return FQuery->DefaultFields;
  }
  return false;
}
//---------------------------------------------------------------------------
// Propriété "Designer"
//---------------------------------------------------------------------------
TDataSetDesigner* __fastcall CEICQuery::GetDesigner(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->Designer;
    else if( FQuery)                           return FQuery->Designer;
  }
  return NULL;
}
//---------------------------------------------------------------------------
// Propriété "Eof"
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::GetEOF(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->Eof;
    else if( FQuery)                           return FQuery->Eof;
  }
  return false;
}
//---------------------------------------------------------------------------
// Propriété "FieldCount"
//---------------------------------------------------------------------------
int __fastcall CEICQuery::GetFieldCount(void)
{  ShowMessage("GetFieldCount");
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->FieldCount;
    else if( FQuery)                           return FQuery->FieldCount;
  }
  return 0;
}
//---------------------------------------------------------------------------
// Propriété "FieldDefList"
//---------------------------------------------------------------------------
TFieldDefList* __fastcall CEICQuery::GetFieldDefList(void)
{

  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->FieldDefList;
    else if( FQuery)                           return FQuery->FieldDefList;
  }
  return NULL;
}
//---------------------------------------------------------------------------
// Propriété "FieldDefs"
//---------------------------------------------------------------------------
TFieldDefs* __fastcall CEICQuery::GetFieldDefs(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->FieldDefs;
    else if( FQuery)                           return FQuery->FieldDefs;
  }
  return NULL;
}
void __fastcall CEICQuery::SetFieldDefs(TFieldDefs* Value)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->FieldDefs = Value;
    else if( FQuery)                           FQuery->FieldDefs   = Value;
  }
}
//---------------------------------------------------------------------------
// Propriété "FieldList"
//---------------------------------------------------------------------------
TFieldList* __fastcall CEICQuery::GetFieldList(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->FieldList;
    else if( FQuery)                           return FQuery->FieldList;
  }
  return NULL;
}
//---------------------------------------------------------------------------
// Propriété "Fields"
//---------------------------------------------------------------------------
TFields * __fastcall CEICQuery::GetFields(void)
{   ShowMessage("GetFields");
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->Fields;
    else if( FQuery)                           return FQuery->Fields;
  }
  return NULL;
}
//---------------------------------------------------------------------------
// Propriété "FieldValues"
//---------------------------------------------------------------------------
Variant __fastcall CEICQuery::GetFieldValue(const AnsiString FieldName)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->FieldValues[FieldName];
    else if( FQuery)                           return FQuery->FieldValues[FieldName];
  }
  return NULL;
}
void __fastcall CEICQuery::SetFieldValue(const AnsiString FieldName, const Variant &Value)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->FieldValues[FieldName] = Value;
    else if( FQuery)                           FQuery->FieldValues[FieldName]   = Value;
  }
}
//---------------------------------------------------------------------------
// Propriété "Found"
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::GetFound(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->Found;
    else if( FQuery)                           return FQuery->Found;
  }
  return false;
}
//---------------------------------------------------------------------------
// Propriété "Modified"
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::GetModified(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->Modified;
    else if( FQuery)                           return FQuery->Modified;
  }
  return false;
}
//---------------------------------------------------------------------------
// Propriété "ParamCount"
//---------------------------------------------------------------------------
Word __fastcall CEICQuery::GetParamsCount(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->ParamCount;
    else if( FQuery)                           return FQuery->ParamCount;
  }
  return 0;
}
//---------------------------------------------------------------------------
// Propriété "Prepared"
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::GetPrepare(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->Prepared;
    else if( FQuery)                           return FQuery->Prepared;
  }
  return false;
}
void __fastcall CEICQuery::SetPrepare(bool Value)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->Prepared = Value;
    else if( FQuery)                           FQuery->Prepared   = Value;
  }
}
//---------------------------------------------------------------------------
// Propriété "RowsAffected"
//---------------------------------------------------------------------------
int  __fastcall CEICQuery::GetRowsAffected(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->RowsAffected;
    else if( FQuery)                           return FQuery->RowsAffected;
  }
  return 0;
}
//---------------------------------------------------------------------------
// Propriété "SparseArrays"
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::GetSparseArrays(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->SparseArrays;
    else if( FQuery)                           return FQuery->SparseArrays;
  }
  return false;
}
void __fastcall CEICQuery::SetSparseArrays(bool Value)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->SparseArrays = Value;
    else if( FQuery)                           FQuery->SparseArrays   = Value;
  }
}
//---------------------------------------------------------------------------
// Propriété "State"
//---------------------------------------------------------------------------
TDataSetState __fastcall CEICQuery::GetState(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->State;
    else if( FQuery)                           return FQuery->State;
  }
  return dsInactive;
}
//---------------------------------------------------------------------------
// Propriété "Text"
//---------------------------------------------------------------------------
AnsiString __fastcall CEICQuery::GetText(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->Text;
    else if( FQuery)                           return FQuery->Text;
  }
  return EmptyStr;
}
//---------------------------------------------------------------------------
// Propriété "UpdatesPending"
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::GetUpdatesPending(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->UpdatesPending;
    else if( FQuery)                           return FQuery->UpdatesPending;
  }
  return false;
}

/*****************************************
 *          PROPRIETES PUBLISHED         *
 *****************************************/
//---------------------------------------------------------------------------
// Propriété "Active"
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::GetActive(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->Active;
    else if( FQuery)                           return FQuery->Active;
  }
  return FActive;
}
void __fastcall CEICQuery::SetActive(bool Value)
{
  FActive = Value;
  if( FDataBase)
  {
    if( Value) SetDatabase(Database);
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->Active = Value;
    else if( FQuery)                           FQuery->Active   = Value;
  }
}
//---------------------------------------------------------------------------
// Propriété "AutoCalcFields"
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::GetAutoCalcFields(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->AutoCalcFields;
    else if( FQuery)                           return FQuery->AutoCalcFields;
  }
  return TDataSet::AutoCalcFields;
}
void __fastcall CEICQuery::SetAutoCalcFields(bool Value)
{
  TDataSet::AutoCalcFields = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->AutoCalcFields = Value;
    else if( FQuery)                           FQuery->AutoCalcFields   = Value;
  }
}
//---------------------------------------------------------------------------
// Propriété "CachedUpdates"
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::GetCachedUpdates(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->CachedUpdates;
    else if( FQuery)                           return FQuery->CachedUpdates;
  }
  return FCachedUpdates;
}
void __fastcall CEICQuery::SetCachedUpdates(bool Value)
{
  FCachedUpdates = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->CachedUpdates = Value;
    else if( FQuery)                           FQuery->CachedUpdates   = Value;
  }
}
//---------------------------------------------------------------------------
// propriété "Constraints"
//---------------------------------------------------------------------------
TCheckConstraints* __fastcall CEICQuery::GetConstraints(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->Constraints;
    else if( FQuery)                           return FQuery->Constraints;
  }
  return FConstraints;
}
void __fastcall CEICQuery::SetConstraints(TCheckConstraints* Value)
{
  FConstraints->Assign( Value);
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->Constraints->Assign( Value);
    else if( FQuery)                           FQuery->Constraints->Assign(   Value);
  }
}
bool __fastcall CEICQuery::ConstraintsStored(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((CEICIBCustomDataSet*)FIBQuery)->ConstraintsStored();
    else if( FQuery)                           return ((CEICDBDataSet*)FQuery)->ConstraintsStored();
  }
  return false;
}
//---------------------------------------------------------------------------
// Propriété "DataBase"
//---------------------------------------------------------------------------
CEICDatabase* __fastcall CEICQuery::GetDatabase(void)
{
  return FDataBase;
}
void __fastcall CEICQuery::SetDatabase(CEICDatabase* Value)
{
  FDataBase = Value;
  if( !FDataBase)
  {
    if( FIBQuery) {delete FIBQuery; FIBQuery = NULL;}
    if( FQuery)   {delete FQuery;   FQuery   = NULL;}
  }
  else
  {
    if( FDataBase->BDEstInterbase)
    {
      if( !FIBQuery)
      {
        FIBQuery = new TIBQuery(NULL);
        //Affectation des Propriétés Published
        FIBQuery->AutoCalcFields = TDataSet::AutoCalcFields;
        FIBQuery->CachedUpdates  = FCachedUpdates;
        FIBQuery->Constraints->Assign( FConstraints);
        FIBQuery->DataSource     = FDataSource;
        FIBQuery->ObjectView     = FObjectView;
        FIBQuery->ParamCheck     = FParamCheck;
        FIBQuery->Params->Assign( FParams);
        FIBQuery->SQL->Assign( FSQL);
        FIBQuery->UniDirectional = FUniDirectional;
        FIBQuery->Active         = FActive;
        //Affectation des Evènemens
        FIBQuery->AfterCancel    = TDataSet::AfterCancel;
        FIBQuery->AfterClose     = TDataSet::AfterClose;
        FIBQuery->AfterDelete    = TDataSet::AfterDelete;
        FIBQuery->AfterEdit      = TDataSet::AfterEdit;
        FIBQuery->AfterInsert    = TDataSet::AfterInsert;
        FIBQuery->AfterOpen      = TDataSet::AfterOpen;
        FIBQuery->AfterPost      = TDataSet::AfterPost;
        FIBQuery->AfterRefresh   = TDataSet::AfterRefresh;
        FIBQuery->AfterScroll    = TDataSet::AfterScroll;
        FIBQuery->BeforeCancel   = TDataSet::BeforeCancel;
        FIBQuery->BeforeClose    = TDataSet::BeforeClose;
        FIBQuery->BeforeDelete   = TDataSet::BeforeDelete;
        FIBQuery->BeforeEdit     = TDataSet::BeforeEdit;
        FIBQuery->BeforeInsert   = TDataSet::BeforeInsert;
        FIBQuery->BeforeOpen     = TDataSet::BeforeOpen;
        FIBQuery->BeforePost     = TDataSet::BeforePost;
        FIBQuery->BeforeRefresh  = TDataSet::BeforeRefresh;
        FIBQuery->BeforeScroll   = TDataSet::BeforeScroll;
        FIBQuery->OnCalcFields   = TDataSet::OnCalcFields;
        FIBQuery->OnDeleteError  = TDataSet::OnDeleteError;
        FIBQuery->OnEditError    = TDataSet::OnEditError;
        FIBQuery->OnFilterRecord = TDataSet::OnFilterRecord;
        FIBQuery->OnNewRecord    = TDataSet::OnNewRecord;
        FIBQuery->OnPostError    = TDataSet::OnPostError;
        FIBQuery->OnUpdateError  = IBDbUpdateErrorEvent;
        FIBQuery->OnUpdateRecord = IBDbUpdateRecordEvent;
      }
      if( Value->IBDataBase) FIBQuery->Database = Value->IBDataBase;
    }
    else
    {
      if( !FQuery)
      {
        FQuery = new TQuery(NULL);
        //Affectation des Propriétés Published
        FQuery->AutoCalcFields = TDataSet::AutoCalcFields;
        FQuery->CachedUpdates  = FCachedUpdates;
        FQuery->Constraints->Assign( FConstraints);
        FQuery->DataSource     = FDataSource;
        FQuery->ObjectView     = FObjectView;
        FQuery->ParamCheck     = FParamCheck;
        FQuery->Params->Assign( FParams);
        FQuery->SQL->Assign( FSQL);
        FQuery->UniDirectional = FUniDirectional;
        FQuery->UpdateMode     = FUpdateMode;
        FQuery->Active         = FActive;
        //if( FUpdateObject) FQuery->UpdateObject->Assign( FUpdateObject);
        //Affectation des Evènements
        FQuery->AfterCancel    = TDataSet::AfterCancel;
        FQuery->AfterClose     = TDataSet::AfterClose;
        FQuery->AfterDelete    = TDataSet::AfterDelete;
        FQuery->AfterEdit      = TDataSet::AfterEdit;
        FQuery->AfterInsert    = TDataSet::AfterInsert;
        FQuery->AfterOpen      = TDataSet::AfterOpen;
        FQuery->AfterPost      = TDataSet::AfterPost;
        FQuery->AfterRefresh   = TDataSet::AfterRefresh;
        FQuery->AfterScroll    = TDataSet::AfterScroll;
        FQuery->BeforeCancel   = TDataSet::BeforeCancel;
        FQuery->BeforeClose    = TDataSet::BeforeClose;
        FQuery->BeforeDelete   = TDataSet::BeforeDelete;
        FQuery->BeforeEdit     = TDataSet::BeforeEdit;
        FQuery->BeforeInsert   = TDataSet::BeforeInsert;
        FQuery->BeforeOpen     = TDataSet::BeforeOpen;
        FQuery->BeforePost     = TDataSet::BeforePost;
        FQuery->BeforeRefresh  = TDataSet::BeforeRefresh;
        FQuery->BeforeScroll   = TDataSet::BeforeScroll;
        FQuery->OnCalcFields   = TDataSet::OnCalcFields;
        FQuery->OnDeleteError  = TDataSet::OnDeleteError;
        FQuery->OnEditError    = TDataSet::OnEditError;
        FQuery->OnFilterRecord = TDataSet::OnFilterRecord;
        FQuery->OnNewRecord    = TDataSet::OnNewRecord;
        FQuery->OnPostError    = TDataSet::OnPostError;
        FQuery->OnUpdateError  = DbUpdateErrorEvent;
        FQuery->OnUpdateRecord = DbUpdateRecordEvent;
      }
      if( Value->BDEDataBase) FQuery->DatabaseName = Value->BDEDataBase->DatabaseName;
    }
  }
  //FDataSetUpdateObject = new CEICDataSetUpdateObject( bBDEstInterbase, Owner);
}

//---------------------------------------------------------------------------
// Propriété "DataSource"
//---------------------------------------------------------------------------
Db::TDataSource* __fastcall CEICQuery::GetDataSource(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->DataSource;
    else if( FQuery)                           return FQuery->DataSource;
  }
  return FDataSource;
}
void __fastcall CEICQuery::SetDataSource(Db::TDataSource* Value)
{
  FDataSource = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->DataSource = Value;
    else if( FQuery)                           FQuery->DataSource   = Value;
  }
}
//---------------------------------------------------------------------------
// Propriété "ObjectView"
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::GetObjectView(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->ObjectView;
    else if( FQuery)                           return FQuery->ObjectView;
  }
  return FObjectView;
}
void __fastcall CEICQuery::SetObjectView(const bool Value)
{
  FObjectView = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->ObjectView = Value;
    else if( FQuery)                           FQuery->ObjectView   = Value;
  }
}
//---------------------------------------------------------------------------
// Propriété "ParamCheck"
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::GetParamCheck(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->ParamCheck;
    else if( FQuery)                           return FQuery->ParamCheck;
  }
  return FParamCheck;
}
void __fastcall CEICQuery::SetParamCheck(bool Value)
{
  FParamCheck = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->ParamCheck = Value;
    else if( FQuery)                           FQuery->ParamCheck   = Value;

  }
}
//---------------------------------------------------------------------------
// Propriété "Params"
//---------------------------------------------------------------------------
Db::TParams* __fastcall CEICQuery::GetParamsList(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->Params;
    else if( FQuery)                           return FQuery->Params;
  }
  return FParams;
}
void __fastcall CEICQuery::SetParamsList(Db::TParams* Value)
{
  FParams->Assign( Value);
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->Params->Assign( Value);
    else if( FQuery)                           FQuery->Params->Assign(   Value);

  }
}
//---------------------------------------------------------------------------
// Propriété "SQL"
//---------------------------------------------------------------------------
Classes::TStrings* __fastcall CEICQuery::GetQuery(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->SQL;
    else if( FQuery)                           return FQuery->SQL;
  }
  return FSQL;
}
void __fastcall CEICQuery::SetQuery(Classes::TStrings* Value)
{
  FSQL->Assign( Value);
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->SQL->Assign( Value);
    else if( FQuery)                           FQuery->SQL->Assign( Value);
  }
}
//---------------------------------------------------------------------------
// Propriété "UniDirectional"
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::GetUniDirectional(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->UniDirectional;
    else if( FQuery)                           return FQuery->UniDirectional;
  }
  return FUniDirectional;
}
void __fastcall CEICQuery::SetUniDirectional(bool Value)
{
  FUniDirectional = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->UniDirectional = Value;
    else if( FQuery)                           FQuery->UniDirectional   = Value;
  }
}
//---------------------------------------------------------------------------
// Propriété "UpdateMode"
//---------------------------------------------------------------------------
Db::TUpdateMode __fastcall CEICQuery::GetUpdateMode(void)
{
  if( FDataBase && !FDataBase->BDEstInterbase && FQuery) return FQuery->UpdateMode;
  return FUpdateMode;
}
void __fastcall CEICQuery::SetUpdateMode(const Db::TUpdateMode Value)
{
  FUpdateMode = Value;
  if( FDataBase && !FDataBase->BDEstInterbase && FQuery) FQuery->UpdateMode = Value;
}
//---------------------------------------------------------------------------
// Propriété "UpdateObject"
//---------------------------------------------------------------------------
/*TDataSetUpdateObject* __fastcall CEICQuery::GetUpdateObject(void)
{
  if( FDataBase && !FDataBase->BDEstInterbase && FQuery) return FQuery->UpdateObject;
  return FUpdateObject;
}
void __fastcall CEICQuery::SetUpdateObject(TDataSetUpdateObject* Value)
{
  if( Value) FUpdateObject->Assign( Value);
  if( FDataBase && !FDataBase->BDEstInterbase && FQuery && Value) FQuery->UpdateObject->Assign( Value);
}*/
/*CEICDataSetUpdateObject* __fastcall CEICQuery::GetUpdateObject(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return (CEICDataSetUpdateObject)FIBQuery->UpdateObject;
    else if( FQuery)                           return (CEICDataSetUpdateObject)FQuery->UpdateObject;
  }
  return FUpdateObject;
}

void __fastcall CEICQuery::SetUpdateObject(CEICDataSetUpdateObject* Value)
{
  FUpdateObject = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->UpdateObject = Value->IBDataSetUpdateObject;
    else if( FQuery)                           FQuery->UpdateObject   = Value->BDEDataSetUpdateObject;
  }
}*/

/******************************
 *          METHODES          *
 ******************************/
void __fastcall CEICQuery::RemoveDataSource(TDataSource* DataSource)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->RemoveDataSource( DataSource);
    else if( FQuery)                           ((CEICDataSet *)FQuery)->RemoveDataSource( DataSource);
  }
}
void __fastcall CEICQuery::AddDataSource(TDataSource* DataSource)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->AddDataSource( DataSource);
    else if( FQuery)                           ((CEICDataSet *)FQuery)->AddDataSource( DataSource);
  }
}
char* __fastcall CEICQuery::ActiveBuffer(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->ActiveBuffer();
    else if( FQuery)                           return FQuery->ActiveBuffer();
  }
  return EmptyStr.c_str();
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::Append(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->Append();
    else if( FQuery)                           return FQuery->Append();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::AppendRecord(const System::TVarRec * Values, const int Values_Size)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->AppendRecord(Values, Values_Size);
    else if( FQuery)                           FQuery->AppendRecord(  Values, Values_Size);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::ApplyUpdates(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->ApplyUpdates();
    else if( FQuery)                           FQuery->ApplyUpdates();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::CancelUpdates(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->CancelUpdates();
    else if( FQuery)                           FQuery->CancelUpdates();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::CheckBrowseMode(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->CheckBrowseMode();
    else if( FQuery)                           FQuery->CheckBrowseMode();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::ClearFields(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->ClearFields();
    else if( FQuery)                           FQuery->ClearFields();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::Close(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->Close();
    else if( FQuery)                           FQuery->Close();
  }
}
//---------------------------------------------------------------------------
int __fastcall CEICQuery::CompareBookmarks(void * Bookmark1, void * Bookmark2)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->CompareBookmarks(Bookmark1, Bookmark2);
    else if( FQuery)                           return FQuery->CompareBookmarks(  Bookmark1, Bookmark2);
  }
  return 0;
}
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::ControlsDisabled(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->ControlsDisabled();
    else if( FQuery)                           return FQuery->ControlsDisabled();
  }
  return false;
}
//---------------------------------------------------------------------------
Classes::TStream* __fastcall CEICQuery::CreateBlobStream(Db::TField* Field, Db::TBlobStreamMode Mode)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->CreateBlobStream(Field, Mode);
    else if( FQuery)                           return FQuery->CreateBlobStream(  Field, Mode);
  }
  return NULL;
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::CursorPosChanged(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->CursorPosChanged();
    else if( FQuery)                           FQuery->CursorPosChanged();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::Delete(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->Delete();
    else if( FQuery)                           FQuery->Delete();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::DisableControls(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->DisableControls();
    else if( FQuery)                           FQuery->DisableControls();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::Edit(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->Edit();
    else if( FQuery)                           FQuery->Edit();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::EnableControls(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->EnableControls();
    else if( FQuery)                           FQuery->EnableControls();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::ExecSQL(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->ExecSQL();
    else if( FQuery)                           FQuery->ExecSQL();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::FetchAll(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->FetchAll();
    else if( FQuery)                           FQuery->FetchAll();
  }
}
//---------------------------------------------------------------------------
TField* __fastcall CEICQuery::FieldByName(const AnsiString FieldName)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->FieldByName(FieldName);
    else if( FQuery)                           return FQuery->FieldByName(  FieldName);
  }
  return NULL;
}
//---------------------------------------------------------------------------
TField* __fastcall CEICQuery::FindField(const AnsiString FieldName)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->FindField(FieldName);
    else if( FQuery)                           return FQuery->FindField(  FieldName);
  }
  return NULL;
}
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::FindFirst(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->FindFirst();
    else if( FQuery)                           return FQuery->FindFirst();
  }
  return false;
}
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::FindLast(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->FindLast();
    else if( FQuery)                           return FQuery->FindLast();
  }
  return false;
}
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::FindNext(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->FindNext();
    else if( FQuery)                           return FQuery->FindNext();
  }
  return false;
}
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::FindPrior(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->FindPrior();
    else if( FQuery)                           return FQuery->FindPrior();
  }
  return false;
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::First(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->First();
    else if( FQuery)                           FQuery->First();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::FreeBookmark(void * Bookmark)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->FreeBookmark(Bookmark);
    else if( FQuery)                           FQuery->FreeBookmark(  Bookmark);
  }
}
//---------------------------------------------------------------------------
void* __fastcall CEICQuery::GetBookmark(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->GetBookmark();
    else if( FQuery)                           return FQuery->GetBookmark();
  }
  return NULL;
}
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::GetCurrentRecord(char * Buffer)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->GetCurrentRecord(Buffer);
    else if( FQuery)                           return FQuery->GetCurrentRecord(  Buffer);
  }
  return false;
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::GetDetailDataSets(Classes::TList* List)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->GetDetailDataSets(List);
    else if( FQuery)                           FQuery->GetDetailDataSets(  List);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::GetDetailLinkFields(Classes::TList* MasterFields, Classes::TList* DetailFields)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->GetDetailLinkFields(MasterFields, DetailFields);
    else if( FQuery)                           FQuery->GetDetailLinkFields(  MasterFields, DetailFields);
  }
}
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::GetFieldData(Db::TField* Field, void * Buffer)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->GetFieldData(Field, Buffer);
    else if( FQuery)                           return FQuery->GetFieldData(  Field, Buffer);
  }
  return false;
}
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::GetFieldData(int FieldNo, void * Buffer)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->GetFieldData(FieldNo, Buffer);
    else if( FQuery)                           return FQuery->GetFieldData(  FieldNo, Buffer);
  }
  return false;
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::GetFieldList(Classes::TList* List, const AnsiString FieldNames)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->GetFieldList(List, FieldNames);
    else if( FQuery)                           FQuery->GetFieldList(  List, FieldNames);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::GetFieldNames(Classes::TStrings* List)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->GetFieldNames(List);
    else if( FQuery)                           FQuery->GetFieldNames(  List);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::GotoBookmark(void * Bookmark)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->GotoBookmark(Bookmark);
    else if( FQuery)                           FQuery->GotoBookmark(  Bookmark);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::Insert(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->Insert();
    else if( FQuery)                           FQuery->Insert();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::InsertRecord(const System::TVarRec * Values, const int Values_Size)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->InsertRecord(Values, Values_Size);
    else if( FQuery)                           FQuery->InsertRecord(  Values, Values_Size);
  }
}
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::IsEmpty(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->IsEmpty();
    else if( FQuery)                           return FQuery->IsEmpty();
  }
  return false;
}
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::IsLinkedTo(TDataSource* DataSource)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->IsLinkedTo(DataSource);
    else if( FQuery)                           return FQuery->IsLinkedTo(  DataSource);
  }
  return false;
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::Last(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->Last();
    else if( FQuery)                           FQuery->Last();
  }
}
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::Locate(const AnsiString KeyFields, const Variant &KeyValues, Db::TLocateOptions Options)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->Locate(KeyFields, KeyValues, Options);
    else if( FQuery)                           return FQuery->Locate(  KeyFields, KeyValues, Options);
  }
  return false;
}
//---------------------------------------------------------------------------
Variant __fastcall CEICQuery::Lookup(const AnsiString KeyFields, const Variant &KeyValues, const AnsiString ResultFields)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->Lookup(KeyFields, KeyValues, ResultFields);
    else if( FQuery)                           return FQuery->Lookup(  KeyFields, KeyValues, ResultFields);
  }
  return NULL;
}
//---------------------------------------------------------------------------
int __fastcall CEICQuery::MoveBy(int Distance)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->MoveBy(Distance);
    else if( FQuery)                           return FQuery->MoveBy(  Distance);
  }
  return 0;
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::Next(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->Next();
    else if( FQuery)                           FQuery->Next();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::Open(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->Open();
    else if( FQuery)                           FQuery->Open();
  }
}
//---------------------------------------------------------------------------
Db::TParam* __fastcall CEICQuery::ParamByName(const AnsiString Value)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->ParamByName(Value);
    else if( FQuery)                           return FQuery->ParamByName(  Value);
  }
  return NULL;
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::Post(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->Post();
    else if( FQuery)                           FQuery->Post();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::Prepare(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->Prepare();
    else if( FQuery)                           FQuery->Prepare();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::Prior(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->Prior();
    else if( FQuery)                           FQuery->Prior();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::Refresh(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->Refresh();
    else if( FQuery)                           FQuery->Refresh();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::Resync(TResyncMode Mode)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->Resync(Mode);
    else if( FQuery)                           FQuery->Resync(  Mode);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::RevertRecord(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->RevertRecord();
    else if( FQuery)                           FQuery->RevertRecord();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::SetFields(const System::TVarRec * Values, const int Values_Size)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->SetFields(Values, Values_Size);
    else if( FQuery)                           FQuery->SetFields(  Values, Values_Size);
  }
}
//---------------------------------------------------------------------------
int __fastcall CEICQuery::Translate(char * Src, char * Dest, bool ToOem)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->Translate(Src, Dest, ToOem);
    else if( FQuery)                           return FQuery->Translate(  Src, Dest, ToOem);
  }
  return 0;
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::UnPrepare(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->UnPrepare();
    else if( FQuery)                           FQuery->UnPrepare();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::UpdateCursorPos(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->UpdateCursorPos();
    else if( FQuery)                           FQuery->UpdateCursorPos();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::UpdateRecord(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->UpdateRecord();
    else if( FQuery)                           FQuery->UpdateRecord();
  }
}
//---------------------------------------------------------------------------
Db::TUpdateStatus __fastcall CEICQuery::UpdateStatus(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->UpdateStatus();
    else if( FQuery)                           return FQuery->UpdateStatus();
  }
  return usUnmodified;
}
//---------------------------------------------------------------------------------
// Redéfinition des fonctions "virtual" de la section Protected du TQuery ou TIBQuery
//---------------------------------------------------------------------------------
char * __fastcall CEICQuery::AllocRecordBuffer(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((MyIBQuery *)FIBQuery)->AllocRecordBuffer();
    else if( FQuery)                           return ((MyQuery*)FQuery)->AllocRecordBuffer();
  }
  return EmptyStr.c_str();
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::DefineProperties(Classes::TFiler* Filer)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((MyIBQuery *)FIBQuery)->DefineProperties( Filer);
    else if( FQuery)                           ((MyQuery*)FQuery)->DefineProperties( Filer);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::Disconnect(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((MyIBQuery *)FIBQuery)->Disconnect();
    else if( FQuery)                           ((MyQuery*)FQuery)->Disconnect();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::FreeRecordBuffer(char * &Buffer)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((MyIBQuery *)FIBQuery)->FreeRecordBuffer(Buffer);
    else if( FQuery)                           ((MyQuery*)FQuery)->FreeRecordBuffer(Buffer);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::GetBookmarkData(char * Buffer, void * Data)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((MyIBQuery *)FIBQuery)->GetBookmarkData(Buffer, Data);
    else if( FQuery)                           ((MyQuery*)FQuery)->GetBookmarkData(Buffer, Data);
  }
}
//---------------------------------------------------------------------------
TBookmarkFlag __fastcall CEICQuery::GetBookmarkFlag(char * Buffer)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((MyIBQuery *)FIBQuery)->GetBookmarkFlag(Buffer);
    else if( FQuery)                           return ((MyQuery*)FQuery)->GetBookmarkFlag(Buffer);
  }
  return bfCurrent;
}
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::GetFieldData(TField* Field, void * Buffer, bool NativeFormat)
{
  return GetFieldData(Field, Buffer);
}
//---------------------------------------------------------------------------
TGetResult __fastcall CEICQuery::GetRecord(char * Buffer, TGetMode GetMode, bool DoCheck)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((MyIBQuery *)FIBQuery)->GetRecord(Buffer, GetMode, DoCheck);
    else if( FQuery)                           return ((MyQuery*)FQuery)->GetRecord(Buffer, GetMode, DoCheck);
  }
  return grError;
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::InternalAddRecord(void * Buffer, bool Append)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((MyIBQuery *)FIBQuery)->InternalAddRecord(Buffer, Append);
    else if( FQuery)                           ((MyQuery*)FQuery)->InternalAddRecord(Buffer, Append);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::InternalClose(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((MyIBQuery *)FIBQuery)->InternalClose();
    else if( FQuery)                           ((MyQuery*)FQuery)->InternalClose();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::InternalDelete(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((MyIBQuery *)FIBQuery)->InternalDelete();
    else if( FQuery)                           ((MyQuery*)FQuery)->InternalDelete();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::InternalFirst(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((MyIBQuery *)FIBQuery)->InternalFirst();
    else if( FQuery)                           ((MyQuery*)FQuery)->InternalFirst();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::InternalGotoBookmark(void * Bookmark)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((MyIBQuery *)FIBQuery)->InternalGotoBookmark(Bookmark);
    else if( FQuery)                           ((MyQuery*)FQuery)->InternalGotoBookmark(Bookmark);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::InternalHandleException(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((MyIBQuery *)FIBQuery)->InternalHandleException();
    else if( FQuery)                           ((MyQuery*)FQuery)->InternalHandleException();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::InternalInitFieldDefs(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((MyIBQuery *)FIBQuery)->InternalInitFieldDefs();
    else if( FQuery)                           ((MyQuery*)FQuery)->InternalInitFieldDefs();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::InternalInitRecord(char * Buffer)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((MyIBQuery *)FIBQuery)->InternalInitRecord(Buffer);
    else if( FQuery)                           ((MyQuery*)FQuery)->InternalInitRecord(Buffer);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::InternalLast(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((MyIBQuery *)FIBQuery)->InternalLast();
    else if( FQuery)                           ((MyQuery*)FQuery)->InternalLast();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::InternalOpen(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((MyIBQuery *)FIBQuery)->InternalOpen();
    else if( FQuery)                           ((MyQuery*)FQuery)->InternalOpen();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::InternalPost(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((MyIBQuery *)FIBQuery)->InternalPost();
    else if( FQuery)                           ((MyQuery*)FQuery)->InternalPost();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::InternalSetToRecord(char * Buffer)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((MyIBQuery *)FIBQuery)->InternalSetToRecord(Buffer);
    else if( FQuery)                           ((MyQuery*)FQuery)->InternalSetToRecord(Buffer);
  }
}
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::IsCursorOpen(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((MyIBQuery *)FIBQuery)->IsCursorOpen();
    else if( FQuery)                           return ((MyQuery*)FQuery)->IsCursorOpen();
  }
  return false;
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::PSExecute(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((MyIBQuery *)FIBQuery)->PSExecute();
    else if( FQuery)                           ((MyQuery*)FQuery)->PSExecute();
  }
}
//---------------------------------------------------------------------------
TParams* __fastcall CEICQuery::PSGetParams(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((MyIBQuery *)FIBQuery)->PSGetParams();
    else if( FQuery)                           return ((MyQuery*)FQuery)->PSGetParams();
  }
  return NULL;
}
//---------------------------------------------------------------------------
AnsiString __fastcall CEICQuery::PSGetTableName(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((MyIBQuery *)FIBQuery)->PSGetTableName();
    else if( FQuery)                           return ((MyQuery*)FQuery)->PSGetTableName();
  }
  return EmptyStr;
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::PSSetParams(TParams* AParams)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((MyIBQuery *)FIBQuery)->PSSetParams( AParams);
    else if( FQuery)                           ((MyQuery*)FQuery)->PSSetParams( AParams);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::PSSetCommandText(const AnsiString CommandText)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((MyIBQuery *)FIBQuery)->PSSetCommandText( CommandText);
    else if( FQuery)                           ((MyQuery*)FQuery)->PSSetCommandText( CommandText);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::SetBookmarkFlag(char * Buffer, TBookmarkFlag Value)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((MyIBQuery *)FIBQuery)->SetBookmarkFlag(Buffer, Value);
    else if( FQuery)                           ((MyQuery*)FQuery)->SetBookmarkFlag(Buffer, Value);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::SetBookmarkData(char * Buffer, void * Data)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((MyIBQuery *)FIBQuery)->SetBookmarkData(Buffer, Data);
    else if( FQuery)                           ((MyQuery*)FQuery)->SetBookmarkData(Buffer, Data);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::SetFieldData(TField* Field, void * Buffer)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((MyIBQuery *)FIBQuery)->SetFieldData(Field, Buffer);
    else if( FQuery)                           ((MyQuery*)FQuery)->SetFieldData(Field, Buffer);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::SetFieldData(TField* Field, void * Buffer, bool NativeFormat)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((MyIBQuery *)FIBQuery)->SetFieldData(Field, Buffer, NativeFormat);
    else if( FQuery)                           ((MyQuery*)FQuery)->SetFieldData(Field, Buffer, NativeFormat);
  }
}
//---------------------------------------------------------------------------
// Redéfinition des fonctions "virtual" de la section Protected du TDataSet
//---------------------------------------------------------------------------
void __fastcall CEICQuery::ActivateBuffers(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->ActivateBuffers();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->ActivateBuffers();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::BlockReadNext(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->BlockReadNext();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->BlockReadNext();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::CalculateFields(char * Buffer)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->CalculateFields( Buffer);
    else if( FQuery)                           ((CEICDataSet *)FQuery)->CalculateFields( Buffer);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::CheckActive(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->CheckActive();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->CheckActive();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::CheckFieldCompatibility(TField* Field, TFieldDef* FieldDef)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->CheckFieldCompatibility( Field, FieldDef);
    else if( FQuery)                           ((CEICDataSet *)FQuery)->CheckFieldCompatibility( Field, FieldDef);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::CheckInactive(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->CheckInactive();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->CheckInactive();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::ClearBuffers(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->ClearBuffers();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->ClearBuffers();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::ClearCalcFields(char * Buffer)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->ClearCalcFields( Buffer);
    else if( FQuery)                           ((CEICDataSet *)FQuery)->ClearCalcFields( Buffer);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::CloseBlob(TField* Field)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->CloseBlob( Field);
    else if( FQuery)                           ((CEICDataSet *)FQuery)->CloseBlob( Field);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::CloseCursor(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->CloseCursor();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->CloseCursor();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::CreateFields(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->CreateFields();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->CreateFields();
  }
}
//---------------------------------------------------------------------------
TDataSet* __fastcall CEICQuery::CreateNestedDataSet(TDataSetField* DataSetField)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((CEICDataSet *)FIBQuery)->CreateNestedDataSet( DataSetField);
    else if( FQuery)                           return ((CEICDataSet *)FQuery)->CreateNestedDataSet( DataSetField);
  }
  return NULL;
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::DataConvert(TField* Field, void * Source, void * Dest, bool ToNative)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->DataConvert( Field, Source, Dest, ToNative);
    else if( FQuery)                           ((CEICDataSet *)FQuery)->DataConvert( Field, Source, Dest, ToNative);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::DataEvent(TDataEvent Event, int Info)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->DataEvent( Event, Info);
    else if( FQuery)                           ((CEICDataSet *)FQuery)->DataEvent( Event, Info);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::DefChanged(System::TObject* Sender)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->DefChanged( Sender);
    else if( FQuery)                           ((CEICDataSet *)FQuery)->DefChanged( Sender);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::DestroyFields(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->DestroyFields();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->DestroyFields();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::DoAfterCancel(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->DoAfterCancel();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->DoAfterCancel();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::DoAfterClose(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->DoAfterClose();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->DoAfterClose();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::DoAfterDelete(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->DoAfterDelete();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->DoAfterDelete();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::DoAfterEdit(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->DoAfterEdit();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->DoAfterEdit();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::DoAfterInsert(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->DoAfterInsert();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->DoAfterInsert();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::DoAfterOpen(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->DoAfterOpen();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->DoAfterOpen();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::DoAfterPost(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->DoAfterPost();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->DoAfterPost();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::DoAfterRefresh(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->DoAfterRefresh();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->DoAfterRefresh();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::DoAfterScroll(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->DoAfterScroll();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->DoAfterScroll();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::DoBeforeCancel(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->DoBeforeCancel();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->DoBeforeCancel();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::DoBeforeClose(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->DoBeforeClose();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->DoBeforeClose();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::DoBeforeDelete(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->DoBeforeDelete();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->DoBeforeDelete();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::DoBeforeEdit(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->DoBeforeEdit();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->DoBeforeEdit();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::DoBeforeInsert(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->DoBeforeInsert();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->DoBeforeInsert();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::DoBeforeOpen(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->DoBeforeOpen();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->DoBeforeOpen();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::DoBeforePost(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->DoBeforePost();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->DoBeforePost();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::DoBeforeRefresh(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->DoBeforeRefresh();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->DoBeforeRefresh();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::DoBeforeScroll(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->DoBeforeScroll();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->DoBeforeScroll();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::DoOnCalcFields(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->DoOnCalcFields();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->DoOnCalcFields();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::DoOnNewRecord(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->DoOnNewRecord();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->DoOnNewRecord();
  }
}
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::FindRecord(bool Restart, bool GoForward)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((CEICDataSet *)FIBQuery)->FindRecord( Restart, GoForward);
    else if( FQuery)                           return ((CEICDataSet *)FQuery)->FindRecord( Restart, GoForward);
  }
  return false;
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::FreeFieldBuffers(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->FreeFieldBuffers();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->FreeFieldBuffers();
  }
}
//---------------------------------------------------------------------------
Variant __fastcall CEICQuery::GetAggregateValue(TField* Field)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((CEICDataSet *)FIBQuery)->GetAggregateValue( Field);
    else if( FQuery)                           return ((CEICDataSet *)FQuery)->GetAggregateValue( Field);
  }
  return NULL;
}
//---------------------------------------------------------------------------
int __fastcall CEICQuery::GetAggRecordCount(TGroupPosInd Grp)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((CEICDataSet *)FIBQuery)->GetAggRecordCount( Grp);
    else if( FQuery)                           return ((CEICDataSet *)FQuery)->GetAggRecordCount( Grp);
  }
  return 0;
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::GetCalcFields(char * Buffer)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->GetCalcFields( Buffer);
    else if( FQuery)                           ((CEICDataSet *)FQuery)->GetCalcFields( Buffer);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::GetChildren(Classes::TGetChildProc Proc, Classes::TComponent* Root)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->GetChildren( Proc, Root);
    else if( FQuery)                           ((CEICDataSet *)FQuery)->GetChildren(Proc, Root);
  }
}
//---------------------------------------------------------------------------
TMetaClass* __fastcall CEICQuery::GetFieldClass(TFieldType FieldType)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((CEICDataSet *)FIBQuery)->GetFieldClass( FieldType);
    else if( FQuery)                           return ((CEICDataSet *)FQuery)->GetFieldClass( FieldType);
  }
  return NULL;
}
//---------------------------------------------------------------------------
AnsiString __fastcall CEICQuery::GetFieldFullName(TField* Field)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((CEICDataSet *)FIBQuery)->GetFieldFullName( Field);
    else if( FQuery)                           return ((CEICDataSet *)FQuery)->GetFieldFullName( Field);
  }
  return EmptyStr;
}
//---------------------------------------------------------------------------
Variant __fastcall CEICQuery::GetStateFieldValue(TDataSetState State, TField* Field)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((CEICDataSet *)FIBQuery)->GetStateFieldValue( State, Field);
    else if( FQuery)                           return ((CEICDataSet *)FQuery)->GetStateFieldValue( State, Field);
  }
  return NULL;
}
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::GetIsIndexField(TField* Field)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((CEICDataSet *)FIBQuery)->GetIsIndexField( Field);
    else if( FQuery)                           return ((CEICDataSet *)FQuery)->GetIsIndexField( Field);
  }
  return false;
}
//---------------------------------------------------------------------------
int __fastcall CEICQuery::GetNextRecords(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((CEICDataSet *)FIBQuery)->GetNextRecords();
    else if( FQuery)                           return ((CEICDataSet *)FQuery)->GetNextRecords();
  }
  return 0;
}
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::GetNextRecord(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((CEICDataSet *)FIBQuery)->GetNextRecord();
    else if( FQuery)                           return ((CEICDataSet *)FQuery)->GetNextRecord();
  }
  return false;
}
//---------------------------------------------------------------------------
int __fastcall CEICQuery::GetPriorRecords(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((CEICDataSet *)FIBQuery)->GetPriorRecords();
    else if( FQuery)                           return ((CEICDataSet *)FQuery)->GetPriorRecords();
  }
  return 0;
}
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::GetPriorRecord(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((CEICDataSet *)FIBQuery)->GetPriorRecord();
    else if( FQuery)                           return ((CEICDataSet *)FQuery)->GetPriorRecord();
  }
  return false;
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::InitFieldDefs(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->InitFieldDefs();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->InitFieldDefs();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::InitRecord(char * Buffer)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->InitRecord( Buffer);
    else if( FQuery)                           ((CEICDataSet *)FQuery)->InitRecord( Buffer);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::InternalCancel(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->InternalCancel();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->InternalCancel();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::InternalEdit(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->InternalEdit();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->InternalEdit();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::InternalInsert(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->InternalInsert();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->InternalInsert();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::InternalRefresh(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->InternalRefresh();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->InternalRefresh();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::Loaded(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->Loaded();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->Loaded();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::OpenCursor(bool InfoQuery)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->OpenCursor(InfoQuery);
    else if( FQuery)                           ((CEICDataSet *)FQuery)->OpenCursor(InfoQuery);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::PSEndTransaction(bool Commit)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->PSEndTransaction( Commit);
    else if( FQuery)                           ((CEICDataSet *)FQuery)->PSEndTransaction( Commit);
  }
}
//---------------------------------------------------------------------------
int __fastcall CEICQuery::PSExecuteStatement(const AnsiString ASQL, TParams* AParams, void * ResultSet)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((CEICDataSet *)FIBQuery)->PSExecuteStatement( ASQL, AParams, ResultSet);
    else if( FQuery)                           return ((CEICDataSet *)FQuery)->PSExecuteStatement( ASQL, AParams, ResultSet);
  }
  return 0;
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::PSGetAttributes(Classes::TList* List)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->PSGetAttributes( List);
    else if( FQuery)                           ((CEICDataSet *)FQuery)->PSGetAttributes( List);
  }
}
//---------------------------------------------------------------------------
TIndexDef* __fastcall CEICQuery::PSGetDefaultOrder(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((CEICDataSet *)FIBQuery)->PSGetDefaultOrder();
    else if( FQuery)                           return ((CEICDataSet *)FQuery)->PSGetDefaultOrder();
  }
  return NULL;
}
//---------------------------------------------------------------------------
AnsiString __fastcall CEICQuery::PSGetKeyFields(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((CEICDataSet *)FIBQuery)->PSGetKeyFields();
    else if( FQuery)                           return ((CEICDataSet *)FQuery)->PSGetKeyFields();
  }
  return EmptyStr;
}
//---------------------------------------------------------------------------
AnsiString __fastcall CEICQuery::PSGetQuoteChar(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((CEICDataSet *)FIBQuery)->PSGetQuoteChar();
    else if( FQuery)                           return ((CEICDataSet *)FQuery)->PSGetQuoteChar();
  }
  return EmptyStr;
}
//---------------------------------------------------------------------------
TIndexDefs* __fastcall CEICQuery::PSGetIndexDefs(TIndexOptions IndexTypes)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((CEICDataSet *)FIBQuery)->PSGetIndexDefs( IndexTypes);
    else if( FQuery)                           return ((CEICDataSet *)FQuery)->PSGetIndexDefs( IndexTypes);
  }
  return NULL;
}
//---------------------------------------------------------------------------
EUpdateError* __fastcall CEICQuery::PSGetUpdateException(Sysutils::Exception* E, EUpdateError* Prev)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((CEICDataSet *)FIBQuery)->PSGetUpdateException( E, Prev);
    else if( FQuery)                           return ((CEICDataSet *)FQuery)->PSGetUpdateException( E, Prev);
  }
  return NULL;
}
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::PSInTransaction(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((CEICDataSet *)FIBQuery)->PSInTransaction();
    else if( FQuery)                           return ((CEICDataSet *)FQuery)->PSInTransaction();
  }
  return false;
}
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::PSIsSQLBased(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((CEICDataSet *)FIBQuery)->PSIsSQLBased();
    else if( FQuery)                           return ((CEICDataSet *)FQuery)->PSIsSQLBased();
  }
  return false;
}
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::PSIsSQLSupported(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((CEICDataSet *)FIBQuery)->PSIsSQLSupported();
    else if( FQuery)                           return ((CEICDataSet *)FQuery)->PSIsSQLSupported();
  }
  return false;
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::PSReset(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->PSReset();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->PSReset();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::PSStartTransaction(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->PSStartTransaction();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->PSStartTransaction();
  }
}
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::PSUpdateRecord(TUpdateKind UpdateKind, TDataSet* Delta)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return ((CEICDataSet *)FIBQuery)->PSUpdateRecord( UpdateKind, Delta);
    else if( FQuery)                           return ((CEICDataSet *)FQuery)->PSUpdateRecord( UpdateKind, Delta);
  }
  return false;
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::RefreshInternalCalcFields(char * Buffer)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->RefreshInternalCalcFields(Buffer);
    else if( FQuery)                           ((CEICDataSet *)FQuery)->RefreshInternalCalcFields(Buffer);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::ResetAggField(TField* Field)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->ResetAggField( Field);
    else if( FQuery)                           ((CEICDataSet *)FQuery)->ResetAggField( Field);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::SetChildOrder(Classes::TComponent* Component, int Order)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->SetChildOrder(Component, Order);
    else if( FQuery)                           ((CEICDataSet *)FQuery)->SetChildOrder(Component, Order);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::SetCurrentRecord(int Index)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->SetCurrentRecord(Index);
    else if( FQuery)                           ((CEICDataSet *)FQuery)->SetCurrentRecord(Index);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::SetState(TDataSetState Value)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->SetState( Value);
    else if( FQuery)                           ((CEICDataSet *)FQuery)->SetState( Value);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::SetStateFieldValue(TDataSetState State, TField* Field, const Variant &Value)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->SetStateFieldValue(State, Field, Value);
    else if( FQuery)                           ((CEICDataSet *)FQuery)->SetStateFieldValue(State, Field, Value);
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::UpdateBufferCount(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->UpdateBufferCount();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->UpdateBufferCount();
  }
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::UpdateIndexDefs(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) ((CEICDataSet *)FIBQuery)->UpdateIndexDefs();
    else if( FQuery)                           ((CEICDataSet *)FQuery)->UpdateIndexDefs();
  }
}
//---------------------------------------------------------------------------
// Redéfinition des fonctions "virtual" de la section Public du TDataSet
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::BookmarkValid(void * Bookmark)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->BookmarkValid( Bookmark);
    else if( FQuery)                           return FQuery->BookmarkValid( Bookmark);
  }
  return false;
}
//---------------------------------------------------------------------------
void __fastcall CEICQuery::Cancel(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->Cancel();
    else if( FQuery)                           FQuery->Cancel();
  }
}
//---------------------------------------------------------------------------
int __fastcall CEICQuery::GetBlobFieldData(int FieldNo, TBlobByteData &Buffer)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->GetBlobFieldData( FieldNo, Buffer);
    else if( FQuery)                           return FQuery->GetBlobFieldData( FieldNo, Buffer);
  }
  return 0;
}
//---------------------------------------------------------------------------
bool __fastcall CEICQuery::IsSequenced(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->IsSequenced();
    else if( FQuery)                           return FQuery->IsSequenced();
  }
  return false;
}

/********************************
 *          EVENEMENTS          *
 ********************************/
//---------------------------------------------------------------------------
// Evènement "AfterCancel"
//---------------------------------------------------------------------------
TDataSetNotifyEvent __fastcall CEICQuery::GetAfterCancel(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->AfterCancel;
    else if( FQuery)                           return FQuery->AfterCancel;
  }
  return TDataSet::AfterCancel;
}
void __fastcall CEICQuery::SetAfterCancel(const TDataSetNotifyEvent Value)
{
  TDataSet::AfterCancel = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->AfterCancel = Value;
    else if( FQuery)                           FQuery->AfterCancel   = Value;
  }
}
//---------------------------------------------------------------------------
// Evènement "AfterClose"
//---------------------------------------------------------------------------
TDataSetNotifyEvent __fastcall CEICQuery::GetAfterClose(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->AfterClose;
    else if( FQuery)                           return FQuery->AfterClose;
  }
  return TDataSet::AfterClose;
}
void __fastcall CEICQuery::SetAfterClose(const TDataSetNotifyEvent Value)
{
  TDataSet::AfterClose = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->AfterClose = Value;
    else if( FQuery)                           FQuery->AfterClose   = Value;
  }
}
//---------------------------------------------------------------------------
// Evènement "AfterDelete"
//---------------------------------------------------------------------------
TDataSetNotifyEvent __fastcall CEICQuery::GetAfterDelete(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->AfterDelete;
    else if( FQuery)                           return FQuery->AfterDelete;
  }
  return TDataSet::AfterDelete;
}
void __fastcall CEICQuery::SetAfterDelete(const TDataSetNotifyEvent Value)
{
  TDataSet::AfterDelete = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->AfterDelete = Value;
    else if( FQuery)                           FQuery->AfterDelete   = Value;
  }
}
//---------------------------------------------------------------------------
// Evènement "AfterEdit"
//---------------------------------------------------------------------------
TDataSetNotifyEvent __fastcall CEICQuery::GetAfterEdit(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->AfterEdit;
    else if( FQuery)                           return FQuery->AfterEdit;
  }
  return TDataSet::AfterEdit;
}
void __fastcall CEICQuery::SetAfterEdit(const TDataSetNotifyEvent Value)
{
  TDataSet::AfterEdit = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->AfterEdit = Value;
    else if( FQuery)                           FQuery->AfterEdit   = Value;
  }
}
//---------------------------------------------------------------------------
// Evènement "AfterInsert"
//---------------------------------------------------------------------------
TDataSetNotifyEvent __fastcall CEICQuery::GetAfterInsert(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->AfterInsert;
    else if( FQuery)                           return FQuery->AfterInsert;
  }
  return TDataSet::AfterInsert;
}
void __fastcall CEICQuery::SetAfterInsert(const TDataSetNotifyEvent Value)
{
  TDataSet::AfterInsert = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->AfterInsert = Value;
    else if( FQuery)                           FQuery->AfterInsert   = Value;
  }
}
//---------------------------------------------------------------------------
// Evènement "AfterOpen"
//---------------------------------------------------------------------------
TDataSetNotifyEvent __fastcall CEICQuery::GetAfterOpen(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->AfterOpen;
    else if( FQuery)                           return FQuery->AfterOpen;
  }
  return TDataSet::AfterOpen;
}
void __fastcall CEICQuery::SetAfterOpen(const TDataSetNotifyEvent Value)
{
  TDataSet::AfterOpen = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->AfterOpen = Value;
    else if( FQuery)                           FQuery->AfterOpen   = Value;
  }
}
//---------------------------------------------------------------------------
// Evènement "AfterPost"
//---------------------------------------------------------------------------
TDataSetNotifyEvent __fastcall CEICQuery::GetAfterPost(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->AfterPost;
    else if( FQuery)                           return FQuery->AfterPost;
  }
  return TDataSet::AfterPost;
}
void __fastcall CEICQuery::SetAfterPost(const TDataSetNotifyEvent Value)
{
  TDataSet::AfterPost = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->AfterPost = Value;
    else if( FQuery)                           FQuery->AfterPost   = Value;
  }
}
//---------------------------------------------------------------------------
// Evènement "AfterRefresh"
//---------------------------------------------------------------------------
TDataSetNotifyEvent __fastcall CEICQuery::GetAfterRefresh(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->AfterRefresh;
    else if( FQuery)                           return FQuery->AfterRefresh;
  }
  return TDataSet::AfterRefresh;
}
void __fastcall CEICQuery::SetAfterRefresh(const TDataSetNotifyEvent Value)
{
  TDataSet::AfterRefresh = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->AfterRefresh = Value;
    else if( FQuery)                           FQuery->AfterRefresh   = Value;
  }
}
//---------------------------------------------------------------------------
// Evènement "AfterScroll"
//---------------------------------------------------------------------------
TDataSetNotifyEvent __fastcall CEICQuery::GetAfterScroll(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->AfterScroll;
    else if( FQuery)                           return FQuery->AfterScroll;
  }
  return TDataSet::AfterScroll;
}
void __fastcall CEICQuery::SetAfterScroll(const TDataSetNotifyEvent Value)
{
  TDataSet::AfterScroll = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->AfterScroll = Value;
    else if( FQuery)                           FQuery->AfterScroll   = Value;
  }
}
//---------------------------------------------------------------------------
// Evènement "BeforeCancel"
//---------------------------------------------------------------------------
TDataSetNotifyEvent __fastcall CEICQuery::GetBeforeCancel(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->BeforeCancel;
    else if( FQuery)                           return FQuery->BeforeCancel;
  }
  return TDataSet::BeforeCancel;
}
void __fastcall CEICQuery::SetBeforeCancel(const TDataSetNotifyEvent Value)
{
  TDataSet::BeforeCancel = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->BeforeCancel = Value;
    else if( FQuery)                           FQuery->BeforeCancel   = Value;
  }
}
//---------------------------------------------------------------------------
// Evènement "BeforeClose"
//---------------------------------------------------------------------------
TDataSetNotifyEvent __fastcall CEICQuery::GetBeforeClose(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->BeforeClose;
    else if( FQuery)                           return FQuery->BeforeClose;
  }
  return TDataSet::BeforeClose;
}
void __fastcall CEICQuery::SetBeforeClose(const TDataSetNotifyEvent Value)
{
  TDataSet::BeforeClose = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->BeforeClose = Value;
    else if( FQuery)                           FQuery->BeforeClose   = Value;
  }
}
//---------------------------------------------------------------------------
// Evènement "BeforeDelete"
//---------------------------------------------------------------------------
TDataSetNotifyEvent __fastcall CEICQuery::GetBeforeDelete(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->BeforeDelete;
    else if( FQuery)                           return FQuery->BeforeDelete;
  }
  return TDataSet::BeforeDelete;
}
void __fastcall CEICQuery::SetBeforeDelete(const TDataSetNotifyEvent Value)
{
  TDataSet::BeforeDelete = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->BeforeDelete = Value;
    else if( FQuery)                           FQuery->BeforeDelete   = Value;
  }
}
//---------------------------------------------------------------------------
// Evènement "BeforeEdit"
//---------------------------------------------------------------------------
TDataSetNotifyEvent __fastcall CEICQuery::GetBeforeEdit(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->BeforeEdit;
    else if( FQuery)                           return FQuery->BeforeEdit;
  }
  return TDataSet::BeforeEdit;
}
void __fastcall CEICQuery::SetBeforeEdit(const TDataSetNotifyEvent Value)
{
  TDataSet::BeforeEdit = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->BeforeEdit = Value;
    else if( FQuery)                           FQuery->BeforeEdit   = Value;
  }
}
//---------------------------------------------------------------------------
// Evènement "BeforeInsert"
//---------------------------------------------------------------------------
TDataSetNotifyEvent __fastcall CEICQuery::GetBeforeInsert(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->BeforeInsert;
    else if( FQuery)                           return FQuery->BeforeInsert;
  }
  return TDataSet::BeforeInsert;
}
void __fastcall CEICQuery::SetBeforeInsert(const TDataSetNotifyEvent Value)
{
  TDataSet::BeforeInsert = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->BeforeInsert = Value;
    else if( FQuery)                           FQuery->BeforeInsert   = Value;
  }
}
//---------------------------------------------------------------------------
// Evènement "BeforeOpen"
//---------------------------------------------------------------------------
TDataSetNotifyEvent __fastcall CEICQuery::GetBeforeOpen(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->BeforeOpen;
    else if( FQuery)                           return FQuery->BeforeOpen;
  }
  return TDataSet::BeforeOpen;
}
void __fastcall CEICQuery::SetBeforeOpen(const TDataSetNotifyEvent Value)
{
  TDataSet::BeforeOpen = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->BeforeOpen = Value;
    else if( FQuery)                           FQuery->BeforeOpen   = Value;
  }
}
//---------------------------------------------------------------------------
// Evènement "BeforePost"
//---------------------------------------------------------------------------
TDataSetNotifyEvent __fastcall CEICQuery::GetBeforePost(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->BeforePost;
    else if( FQuery)                           return FQuery->BeforePost;
  }
  return TDataSet::BeforePost;
}
void __fastcall CEICQuery::SetBeforePost(const TDataSetNotifyEvent Value)
{
  TDataSet::BeforePost = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->BeforePost = Value;
    else if( FQuery)                           FQuery->BeforePost   = Value;
  }
}
//---------------------------------------------------------------------------
// Evènement "BeforeRefresh"
//---------------------------------------------------------------------------
TDataSetNotifyEvent __fastcall CEICQuery::GetBeforeRefresh(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->BeforeRefresh;
    else if( FQuery)                           return FQuery->BeforeRefresh;
  }
  return TDataSet::BeforeRefresh;
}
void __fastcall CEICQuery::SetBeforeRefresh(const TDataSetNotifyEvent Value)
{
  TDataSet::BeforeRefresh = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->BeforeRefresh = Value;
    else if( FQuery)                           FQuery->BeforeRefresh   = Value;
  }
}
//---------------------------------------------------------------------------
// Evènement "BeforeScroll"
//---------------------------------------------------------------------------
TDataSetNotifyEvent __fastcall CEICQuery::GetBeforeScroll(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->BeforeScroll;
    else if( FQuery)                           return FQuery->BeforeScroll;
  }
  return TDataSet::BeforeScroll;
}
void __fastcall CEICQuery::SetBeforeScroll(const TDataSetNotifyEvent Value)
{
  TDataSet::BeforeScroll = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->BeforeScroll = Value;
    else if( FQuery)                           FQuery->BeforeScroll   = Value;
  }
}
//---------------------------------------------------------------------------
// Evènement "OnCalcFields"
//---------------------------------------------------------------------------
TDataSetNotifyEvent __fastcall CEICQuery::GetOnCalcFields(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->OnCalcFields;
    else if( FQuery)                           return FQuery->OnCalcFields;
  }
  return TDataSet::OnCalcFields;
}
void __fastcall CEICQuery::SetOnCalcFields(const TDataSetNotifyEvent Value)
{
  TDataSet::OnCalcFields = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->OnCalcFields = Value;
    else if( FQuery)                           FQuery->OnCalcFields   = Value;
  }
}
//---------------------------------------------------------------------------
// Evènement "OnDeleteError"
//---------------------------------------------------------------------------
TDataSetErrorEvent __fastcall CEICQuery::GetOnDeleteError(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->OnDeleteError;
    else if( FQuery)                           return FQuery->OnDeleteError;
  }
  return TDataSet::OnDeleteError;
}
void __fastcall CEICQuery::SetOnDeleteError(const TDataSetErrorEvent  Value)
{
  TDataSet::OnDeleteError = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->OnDeleteError = Value;
    else if( FQuery)                           FQuery->OnDeleteError   = Value;
  }
}
//---------------------------------------------------------------------------
// Evènement "OnEditError"
//---------------------------------------------------------------------------
TDataSetErrorEvent __fastcall CEICQuery::GetOnEditError(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->OnEditError;
    else if( FQuery)                           return FQuery->OnEditError;
  }
  return TDataSet::OnEditError;
}
void __fastcall CEICQuery::SetOnEditError(const TDataSetErrorEvent  Value)
{
  TDataSet::OnEditError = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->OnEditError = Value;
    else if( FQuery)                           FQuery->OnEditError   = Value;
  }
}
//---------------------------------------------------------------------------
// Evènement "OnFilterRecord"
//---------------------------------------------------------------------------
TFilterRecordEvent __fastcall CEICQuery::GetOnFilterRecord(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->OnFilterRecord;
    else if( FQuery)                           return FQuery->OnFilterRecord;
  }
  return TDataSet::OnFilterRecord;
}
void __fastcall CEICQuery::SetOnFilterRecord(const TFilterRecordEvent  Value)
{
  TDataSet::OnFilterRecord = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->OnFilterRecord = Value;
    else if( FQuery)                           FQuery->OnFilterRecord   = Value;
  }
}
//---------------------------------------------------------------------------
// Evènement "OnNewRecord"
//---------------------------------------------------------------------------
TDataSetNotifyEvent __fastcall CEICQuery::GetOnNewRecord(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->OnNewRecord;
    else if( FQuery)                           return FQuery->OnNewRecord;
  }
  return TDataSet::OnNewRecord;
}
void __fastcall CEICQuery::SetOnNewRecord(const TDataSetNotifyEvent Value)
{
  TDataSet::OnNewRecord = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->OnNewRecord = Value;
    else if( FQuery)                           FQuery->OnNewRecord   = Value;
  }
}
//---------------------------------------------------------------------------
// Evènement "OnPostError"
//---------------------------------------------------------------------------
TDataSetErrorEvent __fastcall CEICQuery::GetOnPostError(void)
{
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) return FIBQuery->OnPostError;
    else if( FQuery)                           return FQuery->OnPostError;
  }
  return TDataSet::OnPostError;
}
void __fastcall CEICQuery::SetOnPostError(const TDataSetErrorEvent  Value)
{
  TDataSet::OnPostError = Value;
  if( FDataBase)
  {
    if( FDataBase->BDEstInterbase && FIBQuery) FIBQuery->OnPostError = Value;
    else if( FQuery)                           FQuery->OnPostError   = Value;
  }
}
//---------------------------------------------------------------------------
// Evènement "OnUpdateError"
//---------------------------------------------------------------------------
void __fastcall CEICQuery::DbUpdateErrorEvent(Db::TDataSet* DataSet, Db::EDatabaseError* E, Db::TUpdateKind UpdateKind, TUpdateAction &UpdateAction)
{
  if( FUpdateErrorEvent)
  {
    ASSERT( DataSet == FQuery);
    FUpdateErrorEvent( DataSet, E, UpdateKind, (CEICUpdateAction &)UpdateAction);
  }
}
void __fastcall CEICQuery::IBDbUpdateErrorEvent(Db::TDataSet* DataSet, Db::EDatabaseError* E, Db::TUpdateKind UpdateKind, TIBUpdateAction &UpdateAction)
{
  if( FUpdateErrorEvent)
  {
    ASSERT( DataSet == FIBQuery);
    FUpdateErrorEvent( DataSet, E, UpdateKind, (CEICUpdateAction &)UpdateAction);
  }
}
//---------------------------------------------------------------------------
// Evènement "OnUpdateRecord"
//---------------------------------------------------------------------------
void __fastcall CEICQuery::DbUpdateRecordEvent(Db::TDataSet* DataSet, Db::TUpdateKind UpdateKind, TUpdateAction &UpdateAction)
{
  if( FUpdateRecordEvent)
  {
    ASSERT( DataSet == FQuery);
    FUpdateRecordEvent( DataSet, UpdateKind, (CEICUpdateAction &)UpdateAction);
  }
}
void __fastcall CEICQuery::IBDbUpdateRecordEvent(Db::TDataSet* DataSet, Db::TUpdateKind UpdateKind, TIBUpdateAction &UpdateAction)
{
  if( FUpdateRecordEvent)
  {
    ASSERT( DataSet == FIBQuery);
    FUpdateRecordEvent( DataSet, UpdateKind, (CEICUpdateAction &)UpdateAction);
  }
}



//---------------------------------------------------------------------------
namespace Ceicquery
{
  void __fastcall PACKAGE Register()
  {
     TComponentClass classes[1] = {__classid(CEICQuery)};
     RegisterComponents("EIC Query", classes, 0);
  }
}
//---------------------------------------------------------------------------

